package JZOffer;

// https://leetcode.cn/problems/ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof/
// 把数字翻译成字符串
public class Day010_1 {
    public int translateNum(int num) {
        if (num == 0) {
            return 1;
        }
        return count(num);
    }

    private int count(int num) {
        if (num % 10 == num) {
            return 1;
        }
        if (num % 100 < 26 && num % 100 > 9) {
            return count(num / 100) + count(num / 10);
        } else {
            return count(num / 10);
        }
    }
}
